/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package classesDAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author andre
 */
public class Conexao {
 
    private static  String URL = "jdbc:postgresql://localhost:5432/postgres";//caminho
    private static  String DRIVER = "org.postgresql.Driver";//driver padrão do mysql arquivo .jar
    private static  String USUARIO = "postgres"; //usuario
    private static  String SENHA = "postgres";//senha

    public static Connection getConnection() throws SQLException {
        try {
            Class.forName(DRIVER);
            return DriverManager.getConnection(URL, USUARIO, SENHA);

        }
        catch (ClassNotFoundException e) {
            System.out.println("Conexão errada");
            throw new SQLException(e.getMessage());

        }
    }


}


